home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
015a
/
scrapenv.zip
/
SCRAPENV.DOC
< prev
next >
Wrap
Text File
|
1991-10-02
|
10KB
|
246 lines
ScrapEnv
ver 1.00
-- A Memory Saving Utility for MS-DOS
by Heath I Hunnicutt
Copyright (C) 1991, Heath I Hunnicutt.
All Rights Reserved.
-------------------------------------------------------------------------------
p2
I. License
This copy of ScrapEnv is provided for evaluation use only. Use
of ScrapEnv may continue for up to 21 days under this license. After
this time, you are required to either discontinue use of ScrapEnv or
remit payment to Heath Hunnicutt. (See last section, Contacting the
Author)
This utility may be copied, transmitted, and otherwise
distributed without limitation, provided that such distribution is done
free of charge to all parties involved. In addition, the utility must
remain in its entirity, composed of the following files:
ScrapEnv.Doc - This file
ScrapEnv.Exe - The program file
Register.Doc - Information about registration
II. Limitation of Warranty
Heath Hunnicutt makes no warranty, express or implied regarding
the use of ScrapEnv, including any warranty of suitability for any
purpose. Heath Hunnicutt will not be liable for any damages associated
with ScrapEnv, whether they be incidental, consequential, coincidental
or otherwise. In particular, this manual clearly states that even
normal use of ScrapEnv in some situations can be detrimental.
p3
III. Introduction
Under the MS-DOS operating system, when a program is loaded, two
memory areas are reserved for it: An environment variable area and a
main program area. Obviously, the main program area is always crucial
to a program's operation. However, the environment area, which averages
256 bytes per program, may not be so critical. The environment contains
such information as the current PATH to search for files in, etc., Some
programs never make any use of this area of memory.
Also under MS-DOS, programs called TSRs have become ubiquitous.
These TSRs load once and remain in memory, either to augment DOS's
system functions, or to return to action when the user presses a
specific key. These TSRs, like any other programs, have environment
areas associated with them. However, the environment is generally of no
use to a TSR, as changes in the 'current' environment are not reflected
in the stored environment area of the TSR, i.e., the TSR's environment
is not up-to-date.
Because the environment space of TSRs is mostly wasted, it is
advantageous to be able to minimize or eliminate this use of memory.
ScrapEnv does just that, by freeing the environment area of the most
recently loaded TSR for use as by DOS.
p4
Depending on the number of TSRs used on a particular system and
the size of the environment as each loads, ScrapEnv can save you
anywhere from a few hundred to a few thousand bytes of main memory.
Here's an example from the DOS 5.0 "mem /debug" command that
illustrates the mmeory usage of environment blocks:
Address Name Size Type
------- -------- ------ ------
008150 MOUSE501 0000E0 Environment
008240 MOUSE501 0032A0 Program
00B4F0 EGAUTIL 0000F0 Environment
00B5F0 EGAUTIL 000680 Program
00BC80 4DOS24H 0000D0 Environment
00BD60 4DOS24H 000A60 Program
00C7D0 MEM 0000E0 Environment
00C8C0 MEM 0135A0 Program
01FE70 MSDOS 080180 -- Free --
603952 largest executable program size
In the above example, there are three TSRs loaded, each with its
own environment block, wasting a total of 688 bytes of main memory.
p 5
After using ScrapEnv, the memory usage looks like this:
Address Name Size Type
------- -------- ------ ------
008150 MEM 0000E0 Environment
008240 MOUSE501 0032A0 Program
00B4F0 EGAUTIL 0000F0 Environment
00B5F0 EGAUTIL 000680 Program
00BC80 4DOS24H 000A60 Program
00C6F0 MEM 0135A0 Program
01FCA0 MSDOS 080350 -- Free --
604416 largest executable program size
Notice that there are now 464 more bytes of main memory
available memory free area. Also notice that ScrapEnv did not remove
EGAUTIL's environment. This is due to the fact that EGAUTIL was loaded
into memory by yet another program with yet another environment segment,
and after the load had completed, ScrapEnv could not decide whether or
not EGAUTIL was the only user of the memory area containing its environment.
A future version of ScrapEnv will be able to specifically eradicate
'lost' environments such as this, and will be available to registered
users of version 1.00 before it will be available to the general public.
p6
IV. Using ScrapEnv
ScrapEnv is used simply by running it IMMEDIATELY AFTER
installing a TSR. For example, the following snippet is of the
Autoexec.Bat file that generated the preceding memory maps:
C:\Driver\Mouse\Mouse501
scrapenv
C:\windows\egautl\egautil /i /d:1 /m
scrapenv
C:\4DOS\4Dos24h
scrapenv
ScrapEnv requires DOS version 3.0 or higher, and will emit a
message to taht effect if it is run on a system that is not compatible.
p7
V. Precautions
Using ScrapEnv may be dangerous. Some TSRs do use their
environment segments. These TSRs might need to know where the DOS
command interpereter is located, or what the search path was when they
were loaded, or some other useful bit of environment information.
Although there are better ways for a TSR to find such information than
using its own environment block, if a TSR does rely on the environment,
then using ScrapEnv on it may well cause it to fail miserably. Such use
may cause the TSR to garble data or worse.
In addition, some very poorly written but popular TSRs actually
overwrite their environment segment with executable code. Scrapping the
environment of such a TSR could lead to disastrous consequences,
including scrambling info on a hard disk, locking up your system, or
whatever other mayhem you can imagine.
The only surefire way to guarantee that a TSR is compatible with
ScrapEnv is to try it out, and see what happens. Understand, however,
that in so doing you take upon yourself all risk associated with
potential damage to your data. It is very advisable for you to have a
complete backup of your hard drive and a print out of your computer's
p8
CMOS setup, if any.
On the brighter side, however, ScrapEnv seems to work well with
the majority of TSRs, particularly newer, more well-written ones.
A finally note: Some TSRs deliberately remove their own
environment segments, since they 'know' they will not use them. Running
ScrapEnv on these TSRs is not neccessary, but will not cause any undo
harm, either. ScrapEnv will simply report that no environment segment
could be found.
p9
VI. Contacting the author and registration.
Heath Hunnicutt may be contacted in any of the following ways:
internet: heathh@cco.caltech.edu
heathh@cobalt.cco.caltech.edu
hihunn@betwixt.ugcs.caltech.edu
snail mail: (Sept-May) Heath Hunnicutt
Box 328 Huntington College
2303 College Ave
Huntington, IN 46750
(219) 358-3643
(June-Aug) Heath Hunnicutt
4700 E 900 S
Warren, IN 46792
(219) 375-3395
p10
Registration for ScrapEnv is $10.00 and includes a registered
copy of ScrapEnv on disk, a printed manual, and one free upgrade to the
next version of ScrapEnv.
In addition, the registered version of ScrapEnv never requires a
keystroke to proceed, and does not expire after a period of time.
(Surprise! Those of you who think you are going to freeload are
mistaken, just wait till a certain date rolls around, and ScrapEnv
refuses to work.) Also, the registered version can be instructed to not
display such a lengthy message on start-up.
If you would like to register your current version of ScrapEnv,
but do not want the manual or free upgrades, send $5.00 to the above
address, and you will receive a registered copy, and one notice of
future upgrades.
For your convenience, please use the included register.doc as a
registration form.